package com.corn.turorial.spring.servlet;

import org.springframework.http.MediaType;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author : Jim Wu
 * @version 1.0
 * @function :
 * @since : 2021/2/8 10:11
 */
//@WebServlet(urlPatterns = {"/my/Servlet"})
public class MyCustomerServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType(MediaType.APPLICATION_JSON_VALUE);
        resp.getWriter().write("from my servlet!");
    }
}
